1. /* smanager.cpp by K.Tsuru */
  2. /*****************************
  3. SNManager class
  4. ******************************/
  5. #ifndef SN_H
  6. #include "sn.h"
  7. #endif
  8. //the maximum integral value which can be expressed by double = 1.0e15
  9. const double INT_MAX_DBL = dpow10(DOUBLE_FIG);
  10. /*
  11. the pointer to the memory free function
  12. */
  13. // SNStack <void (*)()> SNManager::MemFreeFunc; // deleted since 2.30
  14. // Creation and initilization of static objects.
  15. #ifdef NDEBUG
  16. bool SNManager::verify = OFF; //verify or not in the division routine, etc
  17. bool SNManager::fftVerify = OFF;// verify or not in the rounding off FFT multiplication
  18. bool SNManager::showMessage = OFF; // Show a message "Evaluating Pi() now." or not.
  19. #else
  20. bool SNManager::verify = ON;
  21. bool SNManager::fftVerify = ON;
  22. bool SNManager::showMessage = ON;
  23. #endif
  24. SNManager::SNErrorFlag SNManager::errorFlag = (SNManager::SNErrorFlag)NO_ERR;
  25. char* SNManager::place = NULL;
  26. long SNManager::objectCounter = -1;
  27. FILE* SNManager::stream = stdout;
  28. ostream& SNManager::sn_ost = cout; // std::output stream. default is "std::cout".
  29. // FFT
  30. uint SNManager::fftArraySize = 0;
  31. uint SNManager::fftMinSize = defaultFFTMinSize;
  32. bool SNManager::fftUse = ON;
  33. long SNManager::fftUsedTimes = 0;
  34. long SNManager::KaratsubaHHMultUsedTimes = 0;
  35. bool SNManager::preferSpeed = false;
  36. void SNManager::ShowMessage(const char* msg){
  37. if(showMessage) cerr << msg; // version 2.20
  38. }
  39. //It is called by the error of new operator.
  40. void OutOfMemory(){
  41. cerr << "\nSN library : Sorry, out of memory!" << endl; exit(EXIT_FAILURE); // version 2.20
  42. }
  43. // function ID = 009
  44. /*
  45. destructor
  46. */
  47. SNManager::~SNManager(){
  48. delete[] place; place = NULL;
  49. // CloseFile(); // Do not ececute
  50. // cerr << "objectCounter = " << objectCounter << endl;
  51. }

smanager.cpp : last modifiled at 2017/08/22 16:31:36(1,816 bytes)
created at 2016/04/11 11:36:47
The creation time of this html file is 2017/10/27 10:59:17 (Fri Oct 27 10:59:17 2017).